<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        li{
            width: 140px;
            height: 140px;
            margin-left: 50px;
            list-style: none;
            border: 3px solid red;
            float: left;
            text-align: center;
            line-height: 140px;
            color: rgba(0, 0,0,0);
            cursor: pointer;
            user-select: none;
            font-size: 30px;
        }
    </style>
</head>
<body>
    <ul>
        <li>第1个</li>
        <li>第2个</li>
        <li>第3个</li>
        <li>第4个</li>
        <li>第5个</li>
    </ul>
</body>
</html>
<script src="../day01/js/lodash.js"></script>
<script src="../案例/随机颜色.js"></script>
<script>
    const val = document.querySelectorAll('li')
    val.forEach(function(item){
        item.onclick = function(){
            // item.style.color = 'red'
            val.forEach(function(li){
                li.style.color = 'rgba(0,0,0,0)'
                li.style.background = 'rgba(0,0,0,0)'
                // color: rgba(0, 0,0,0);
            })
            this.style.color = `${fn1()}`
            this.style.background = `${fn1()}`
        }
    })
</script>